﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Script.Services;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

using ScottCateAjax2008.Lesson02;

namespace ScottCateAjax2008.Services
{
    /// <summary>
    /// Summary description for CustomNouns
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    [ScriptService]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class CustomNouns : System.Web.Services.WebService
    {
        [WebMethod]
        public List<Things> GetNouns()
        {
            return new List<Things>
                       {
                           new Things() {Name = "Scott", Noun = Noun.Person},
                           new Things() {Name = "Arizona" , Noun = Noun.Place},
                           new Things() {Name = "Corvete", Noun = Noun.Thing}
                       }
            ;
        }


    }

    public class Things
    {
        public Noun Noun { get; set; }
        public String Name { get; set; }
    }
}
